﻿#pragma once
#include "base/WrapperVtkmTypes.h"
#include <vtkm/CellShape.h>
using vtkm::CellShapeIdEnum;

enum Order {
    CONSTANT = 0,
    FIRST = 1,
    SECOND = 2,
    THIRD = 3,
    FOURTH = 4,
    FIFTH = 5,

    // Invalid
    INVALID_ORDER
};

class Quadrature
{
public:
	Quadrature() {};
	~Quadrature() {};

private:
	
};

using vtkm::CellShapeIdEnum;

template<CellShapeIdEnum Shape, Order order>
class QGauss
{
};

template<>
struct QGauss<vtkm::CELL_SHAPE_LINE, SECOND>
{
    static constexpr IdComponent NUM_COMPONENTS = 2;
    static constexpr FloatDefault a = 0.21132486540518711774542560974902L;
    static constexpr FloatDefault b = 0.78867513459481288225457439025098L;

    static constexpr Vec3f points[2] = { {a,0,0},{b,0,0} };
    static constexpr FloatDefault weight[2] = {1.0, 1.0}; 
};

template<>
struct QGauss<vtkm::CELL_SHAPE_TRIANGLE, SECOND>
{
    static constexpr  IdComponent NUM_COMPONENTS = 3;
    static constexpr Vec3f points[3] = { {2./3,1./6,0},{1./6,2./3,0},{1./6,1./6,0} };
    static constexpr FloatDefault weight[3] = { 1./6, 1./6, 1./6 };
};

template<>
struct QGauss<vtkm::CELL_SHAPE_QUAD, SECOND>
{
   static constexpr IdComponent NUM_COMPONENTS = 4;
   static constexpr FloatDefault a = 0.21132486540518711774542560974902L;
   static constexpr FloatDefault b = 0.78867513459481288225457439025098L;
   static constexpr FloatDefault w = 0.25;
   static constexpr Vec3f points[4] = { {a,a,0},{b,a,0},{b,b,0},{a,b,0} };
   static constexpr FloatDefault weight[4] = {w,w,w,w };
};

//void Get(vtkm::CellShapeTagGeneric shape, Order order)
//{
//    auto q = QGauss<vtkm::CELL_SHAPE_QUAD, FIRST>{};
//}